spammR 0.1
To install the package currently you must install directly from GitHub along with the leapR dependency as shown below. Before release we hope to move to Bioconductor.
The leapR package is designed for flexible pathway enrichment and currently must be installed before spammR.
##install if not already installed
library(devtools)
devtools::install_github('PNNL-CompBio/leapR')
devtools::install_github('PNNL-CompBio/spammR')
Once the package is installed you load the library, including the test data.
##load spammR
library(spammR)
spammR enables the analysis of disparate sets of multiomic data: image-based data and numerical measurements of omics data. It is incredibly flexible as to the type of multiomic data. We assume each omics measurement is collected in a single sample, and that there are specific spatial coordinates for that sample in the image. We leverage the SpatialExperiment object to store the data for each image/measurement pair.
The spammR package requires omics data with spatial coordinates for the functions to run successfully. Here we describe the data required and show examples.
SpatialExperiment can hold multiple omics measurements mapping to the same sample identifier in different ‘slots’. This data can be a tabular data frame or matrix with rownames referencing measurements in a particular sample (e.g. gene, species) and column names representing sample identifiers. An example of this can be found by loading data(pancData).
To evaluate the features of this package we are using pancreatic data from Gosline et al. that is captured using mass spectrometry measured from 7 independent regions of a single human pancreas. Each image is segmented into nine ‘voxels’, with one voxel per image representing a cluster of islet cells.
data(pancData)
utils::head(pancData[,1:8])
## 0_S_1_1 0_S_1_2 0_S_1_3 0_S_2_1 0_S_2_2 0_S_2_3
## sp|A0A024RBG1|NUD4B_HUMAN 13.06042 13.42317 12.42396 13.02470 12.56442 12.69023
## sp|A0A096LP55|QCR6L_HUMAN 15.10920 15.27460 15.16780 15.01030 15.46639 14.73712
## sp|A0AV96|RBM47_HUMAN 17.40246 17.29727 17.25559 17.34851 17.12866 17.17658
## sp|A0AVT1|UBA6_HUMAN 18.00653 18.43015 18.24663 18.17563 18.38961 18.29268
## sp|A0FGR8|ESYT2_HUMAN 16.59018 16.48890 16.50134 16.55334 16.32316 16.43397
## sp|A0MZ66|SHOT1_HUMAN 18.19277 18.73633 18.54485 18.20005 18.74041 18.70762
## 0_S_3_1 0_S_3_2
## sp|A0A024RBG1|NUD4B_HUMAN NA 13.40670
## sp|A0A096LP55|QCR6L_HUMAN 14.81792 15.63741
## sp|A0AV96|RBM47_HUMAN 17.27792 17.11678
## sp|A0AVT1|UBA6_HUMAN 18.12080 18.10220
## sp|A0FGR8|ESYT2_HUMAN 16.43682 16.20515
## sp|A0MZ66|SHOT1_HUMAN 18.60198 18.62946
Here the rownames represent protein identifiers and the column names represent individual samples. In this table we collapse omics data from 7 distinct experiments into a single data frame to increase statistical power in our pathway analysis. However, we can also separate them out by image, as we do in the data(pancDataList):
data(pancDataList)
print(length(pancDataList))
## [1] 7
head(pancDataList[[2]][,1:8])
## 1_S_1_1 1_S_1_2 1_S_1_3 1_S_2_1 1_S_2_2 1_S_2_3
## sp|A0A024RBG1|NUD4B_HUMAN NA NA NA NA NA NA
## sp|A0A096LP55|QCR6L_HUMAN NA NA NA NA NA NA
## sp|A0AV96|RBM47_HUMAN 17.68866 17.58076 17.51335 17.65900 17.52926 17.44999
## sp|A0AVT1|UBA6_HUMAN 18.02235 18.35493 18.03651 18.09462 18.08796 18.04204
## sp|A0FGR8|ESYT2_HUMAN 17.50177 17.51525 17.34338 17.41622 17.34254 17.46062
## sp|A0MZ66|SHOT1_HUMAN 18.57445 18.67262 18.83672 18.69094 18.48785 18.75190
## 1_S_3_1 1_S_3_2
## sp|A0A024RBG1|NUD4B_HUMAN NA NA
## sp|A0A096LP55|QCR6L_HUMAN NA NA
## sp|A0AV96|RBM47_HUMAN 17.37103 17.50367
## sp|A0AVT1|UBA6_HUMAN 18.21052 17.94707
## sp|A0FGR8|ESYT2_HUMAN 17.31495 17.53217
## sp|A0MZ66|SHOT1_HUMAN 18.82805 18.48856
These objects are used below in our analysis examples.
The samples metadata table contains mappings between samples and metadata. An example can be found in data(pancMeta). Most importantly we require the image mapping information, which includes:
- Image coordinates: to map the image to a coordinate space we need to know the x_origin, and y_origin (assumed to be zero) as well as x_max and y_max, which is the top right of the image. The package plost the entire image so specifying these coordinates ensures that all other points are properly mapped.
- Sample coordinates: Each sample has its own x_coord and y_coord.
- Spot size: spot_height and spot_width.
data(pancMeta)
head(pancMeta)
## Image x_coord y_coord IsletStatus IsletOrNot Plex Grid.Number x_pixels
## 0_S_3_1 0 3 1 Proximal NonIslet 127N 1 475
## 0_S_2_1 0 2 1 Islet Islet 128N 2 380
## 0_S_1_1 0 1 1 Proximal NonIslet 127C 3 285
## 0_S_3_2 0 3 2 Proximal NonIslet 128C 4 475
## 0_S_2_2 0 2 2 Proximal NonIslet 129N 5 380
## 0_S_1_2 0 1 2 Proximal NonIslet 129C 6 285
## y_pixels x_origin y_origin x_max y_max spot_width spot_height
## 0_S_3_1 170 0 0 860 725 90 140
## 0_S_2_1 170 0 0 860 725 90 140
## 0_S_1_1 170 0 0 860 725 90 140
## 0_S_3_2 315 0 0 860 725 90 140
## 0_S_2_2 315 0 0 860 725 90 140
## 0_S_1_2 315 0 0 860 725 90 140
This metadata contains information for all 7 images, so we do not need a separate metadata file for each image, the convert_to_spe function will simply take the metadata relevant to the data file.
There can be multiple image files associated with a single set of omics measurements. Currently we have tested working with files in png format. Each image we have is stained so that we can identify the Islet cells. Each image also has a grid superimposed to show where the sample measurements came from. The grid is not necessary, of course, but can help calibrate the coordinates.
library(cowplot)
##
## Attaching package: 'cowplot'
## The following object is masked from 'package:spammR':
##
## get_legend
cowplot::ggdraw()+cowplot::draw_image('../inst/extdata/Image_1.png')
Now we can use this image and others to visualize omics data.
The last set of metadata relates to the rows of the omics measurement data. When using gene-based data, this will be the genes or proteins in the dataset. When using metagenomics, this will refer to the species. One column of this table must uniquely map to the rownames of the omics data.
data(protMeta)
head(protMeta[,c('pancProts','EntryName','PrimaryGeneName')])
## pancProts EntryName PrimaryGeneName
## 1 sp|A0A024RBG1|NUD4B_HUMAN NUD4B_HUMAN NUDT4B
## 2 sp|A0A096LP55|QCR6L_HUMAN QCR6L_HUMAN UQCRHL
## 3 sp|A0AV96|RBM47_HUMAN RBM47_HUMAN RBM47
## 4 sp|A0AVT1|UBA6_HUMAN UBA6_HUMAN UBA6
## 5 sp|A0FGR8|ESYT2_HUMAN ESYT2_HUMAN ESYT2
## 6 sp|A0MZ66|SHOT1_HUMAN SHOT1_HUMAN SHTN1
This data helps us find better gene identifiers.
Now that we have all the data loaded we can build a SpatialExperiment object either using ALL samples or just the samples in a single image.
pooled.panc.spe <- convert_to_spe(pancData, ##pooled data table
pancMeta, ##pooled metadata
protMeta, ##protein identifiers
feature_meta_colname='pancProts', #column name
samples_common_identifier='')
## Mapping metadata for 6662 features out of 6693 data points
print(pooled.panc.spe)
## class: SpatialExperiment
## dim: 6662 63
## metadata(0):
## assays(1): proteomics
## rownames(6662): sp|A0A024RBG1|NUD4B_HUMAN sp|A0A096LP55|QCR6L_HUMAN ...
## sp|Q9Y3M8|STA13_HUMAN sp|Q9Y6X3|SCC4_HUMAN
## rowData names(6): pancProts Entry ... GeneNames PrimaryGeneName
## colnames(63): 0_S_1_1 0_S_1_2 ... 7_S_3_2 7_S_3_3
## colData names(16): Image x_coord ... spot_height sample_id
## reducedDimNames(0):
## mainExpName: NULL
## altExpNames(0):
## spatialCoords names(2) : x_pixels y_pixels
## imgData names(0):
We can also create a list of SpatialExperiment objects, one for each of the 7 images we have.
Now we can use these individual image objects or the combined ‘pooled’ object for analysis.
Here we loop over all of the images in imglist to plot the expression of the insulin protein in each image. We expect insulin (or INS) to be highest in voxels containing islet cells, which we label using the label_column ‘IsletOrNot’ which was loaded into the metadata for us.
allimgs = lapply(imglist,function(x){
spe = img.spes[[x]]
res = spatial_heatmap(spe, feature = 'INS',
feature_type='PrimaryGeneName',
sample_id=x,
image_id='with_grid',
spatial_coord_names=c('x_pixels','y_pixels'),
spot_size=unlist(colData(spe)[1,c('spot_width',
'spot_height')]),
image_boundaries=unlist(colData(spe)[1,c('x_origin',
'y_origin',
'x_max',
'y_max')]),
label_column='IsletOrNot', interactive=FALSE)
return(res)}
)
cowplot::plot_grid(allimgs[[2]],allimgs[[3]],nrow=2)
To go further and visualize entire pathways we need to first identify which groups of proteins are of interest using a more unsupervised approach.
Now that we have the ability to overlay omic measurements with image ones, we can identify new features to plot and visualize them. First we can employ standard differential expression approaches using the voxel labels and the limma pathway.
First we want to identify specific proteins that are up-regulated in the islet cells (or regions labeled ‘islet’) compared to other regions. We can then plot the set of proteins.
islet_res <- calc_spatial_diff_ex(pooled.panc.spe,
assay_name='proteomics',
log_transformed=FALSE,
category_col='IsletOrNot')
sig_prots<-subset(rowData(islet_res),NonIslet_vs_Islet.adj.P.Val.limma<0.01)
ups<-subset(sig_prots, NonIslet_vs_Islet.logFC.limma>0)
downs<-subset(sig_prots, NonIslet_vs_Islet.logFC.limma<0)
print(paste('We found',nrow(sig_prots),'significantly differentally expressed proteins including',
nrow(ups),'upregulated proteins and',nrow(downs),'downregulated'))
## [1] "We found 241 significantly differentally expressed proteins including 168 upregulated proteins and 73 downregulated"
Now we can plot those differentially expressed proteins across images.
If we are interested in the combined expression of proteins we can also visualize those.
spe.plot = img.spes[[1]]
##we need the image boundaries based on the x/y coordinates. The image will
##be stretched between the origin and max in both directions
bounds = unlist(SummarizedExperiment::colData(spe.plot)[1,c('x_origin',
'y_origin',
'x_max',
'y_max')])
#the spot size can vary between every sample, but for now
# we assume a square spot (with a width and a height)
sizes = unlist(SummarizedExperiment::colData(spe.plot)[1,c('spot_width',
'spot_height')])
hup<-spatial_heatmap(spe.plot,feature=rownames(ups),
sample_id='Image_0',
image_id='with_grid',
spatial_coord_names=c('x_pixels','y_pixels'),
spot_size=sizes,
image_boundaries=bounds,
label_column='IsletOrNot',
interactive=FALSE)
hup
##what if we want to plot in image 3?
spe.plot = img.spes[[2]]
##we need the image boundaries based on the x/y coordinates. The image will
##be stretched between the origin and max in both directions
bounds = unlist(SummarizedExperiment::colData(spe.plot)[1,c('x_origin',
'y_origin',
'x_max',
'y_max')])
#the spot size can vary between every sample, but for now
# we assume a square spot (with a width and a height)
sizes = unlist(SummarizedExperiment::colData(spe.plot)[1,c('spot_width',
'spot_height')])
hup<-spatial_heatmap(spe.plot,feature=rownames(ups),
sample_id='Image_1',
image_id='with_grid',
spatial_coord_names=c('x_pixels','y_pixels'),
spot_size=sizes,
image_boundaries=bounds,
label_column='IsletOrNot',
interactive=FALSE)
Now we can calculate the enriched pathways in the islets.
library(leapR)
ora.res <- enrich_ora(islet_res,geneset=msigdb,geneset_name='msigdb', feature_column='PrimaryGeneName')
print(ora.res[grep("INSULIN",ora.res$msigdb),c('ingroup_n','pvalue','BH_pvalue')])
## ingroup_n
## REACTOME_GLUCOSE_REGULATION_OF_INSULIN_SECRETION 20
## REACTOME_REGULATION_OF_INSULIN_SECRETION 21
## REACTOME_INSULIN_SYNTHESIS_AND_SECRETION 1
## ROME_INSULIN_TARGETS_IN_MUSCLE_UP 3
## ROME_INSULIN_TARGETS_IN_MUSCLE_DN 0
## INSULIN_RECEPTOR_SIGNALING_PATHWAY 1
## INSULIN_LIKE_GROWTH_FACTOR_RECEPTOR_BINDING 0
## KEGG_INSULIN_SIGNALING_PATHWAY 4
## BIOCARTA_INSULIN_PATHWAY 0
## REACTOME_REGULATION_OF_INSULIN_LIKE_GROWTH_FACTOR_ACTIVITY_BY_INSULIN_LIKE_GROWTH_FACTOR_BINDING_PROTEINS 0
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_ACETYLCHOLINE 1
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_GLUCAGON_LIKE_PEPTIDE_1 2
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_FREE_FATTY_ACIDS 1
## REACTOME_INHIBITION_OF_INSULIN_SECRETION_BY_ADRENALINE_NORADRENALINE 1
## SIG_INSULIN_RECEPTOR_PATHWAY_IN_CARDIAC_MYOCYTES 0
## pvalue
## REACTOME_GLUCOSE_REGULATION_OF_INSULIN_SECRETION 5.605362e-05
## REACTOME_REGULATION_OF_INSULIN_SECRETION 5.644935e-04
## REACTOME_INSULIN_SYNTHESIS_AND_SECRETION 6.724402e-03
## ROME_INSULIN_TARGETS_IN_MUSCLE_UP 1.000000e+00
## ROME_INSULIN_TARGETS_IN_MUSCLE_DN 6.192583e-01
## INSULIN_RECEPTOR_SIGNALING_PATHWAY 5.169713e-01
## INSULIN_LIKE_GROWTH_FACTOR_RECEPTOR_BINDING 1.000000e+00
## KEGG_INSULIN_SIGNALING_PATHWAY 8.197269e-01
## BIOCARTA_INSULIN_PATHWAY 1.000000e+00
## REACTOME_REGULATION_OF_INSULIN_LIKE_GROWTH_FACTOR_ACTIVITY_BY_INSULIN_LIKE_GROWTH_FACTOR_BINDING_PROTEINS 1.000000e+00
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_ACETYLCHOLINE 1.000000e+00
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_GLUCAGON_LIKE_PEPTIDE_1 1.000000e+00
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_FREE_FATTY_ACIDS 1.000000e+00
## REACTOME_INHIBITION_OF_INSULIN_SECRETION_BY_ADRENALINE_NORADRENALINE 1.000000e+00
## SIG_INSULIN_RECEPTOR_PATHWAY_IN_CARDIAC_MYOCYTES 1.679950e-01
## BH_pvalue
## REACTOME_GLUCOSE_REGULATION_OF_INSULIN_SECRETION 0.01266744
## REACTOME_REGULATION_OF_INSULIN_SECRETION 0.05970401
## REACTOME_INSULIN_SYNTHESIS_AND_SECRETION 0.33657876
## ROME_INSULIN_TARGETS_IN_MUSCLE_UP 1.00000000
## ROME_INSULIN_TARGETS_IN_MUSCLE_DN 1.00000000
## INSULIN_RECEPTOR_SIGNALING_PATHWAY 1.00000000
## INSULIN_LIKE_GROWTH_FACTOR_RECEPTOR_BINDING 1.00000000
## KEGG_INSULIN_SIGNALING_PATHWAY 1.00000000
## BIOCARTA_INSULIN_PATHWAY 1.00000000
## REACTOME_REGULATION_OF_INSULIN_LIKE_GROWTH_FACTOR_ACTIVITY_BY_INSULIN_LIKE_GROWTH_FACTOR_BINDING_PROTEINS 1.00000000
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_ACETYLCHOLINE 1.00000000
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_GLUCAGON_LIKE_PEPTIDE_1 1.00000000
## REACTOME_REGULATION_OF_INSULIN_SECRETION_BY_FREE_FATTY_ACIDS 1.00000000
## REACTOME_INHIBITION_OF_INSULIN_SECRETION_BY_ADRENALINE_NORADRENALINE 1.00000000
## SIG_INSULIN_RECEPTOR_PATHWAY_IN_CARDIAC_MYOCYTES 1.00000000
We know that there are significantly enriched pathways in insulin secretion, so let’s plot those.
secprots<-subset(ora.res,msigdb=='REACTOME_GLUCOSE_REGULATION_OF_INSULIN_SECRETION')|>dplyr::select(ingroupnames)|>
unlist()|>strsplit(split=', ')|>unlist()
spe.plot = img.spes[[2]]
##we need the image boundaries based on the x/y coordinates. The image will
##be stretched between the origin and max in both directions
bounds = unlist(SummarizedExperiment::colData(spe.plot)[1,c('x_origin',
'y_origin',
'x_max',
'y_max')])
#the spot size can vary between every sample, but for now
# we assume a square spot (with a width and a height)
sizes = unlist(SummarizedExperiment::colData(spe.plot)[1,c('spot_width',
'spot_height')])
hup<-spatial_heatmap(spe.plot,feature=secprots,
sample_id='Image_1',
image_id='with_grid',
spatial_coord_names=c('x_pixels','y_pixels'),
feature_type='PrimaryGeneName',
spot_size=sizes,
image_boundaries=bounds,
label_column='IsletOrNot',
plot_title='Glucose regulation proteins',
interactive=FALSE)
The average expression of the 20 proteins selected is shown to be higher in islet cells than adjacent cells.
We can also identify features that are correlated with distance to a feature or a gradient in the sample. This will provide input to rank-based statistical tools that can help identify pathways.
First we identify a specific feature, the Islet cell, and use that to identify proteins correlated with distance from the islet in each image. Proteins with a negative correlation are decreasing in expression as they are farther from the islet cells.
##for each image, let's compute the distance of each voxel to the one labeled 'Islet'
rank.imgs<-lapply(img.spes,
function(x) distance_based_analysis(x,'proteomics',
sampleCategoryCol='IsletOrNot',
sampleCategoryValue='Islet'))
##now we have the distances, let's plot some interesting proteins
negProts<-do.call(rbind, lapply(names(rank.imgs),function(x)
subset(as.data.frame(rowData(rank.imgs[[x]])),IsletDistancespearmanPval<0.01)|>
subset(IsletDistancespearmanCor<(-.75))|>
dplyr::select(PrimaryGeneName,IsletDistancespearmanCor)|>
dplyr::mutate(image=x)))
print(head(negProts))
## PrimaryGeneName IsletDistancespearmanCor image
## sp|A6NFH5|FBP12_HUMAN FABP12 -0.9621024 Image_0
## sp|O14979|HNRDL_HUMAN HNRNPDL -0.9114654 Image_0
## sp|O15145|ARPC3_HUMAN ARPC3 -0.8861469 Image_0
## sp|O43292|GPAA1_HUMAN GPAA1 -0.8355100 Image_0
## sp|O43829|ZBT14_HUMAN ZBTB14 -0.8608285 Image_0
## sp|O60256|KPRB_HUMAN PRPSAP2 -0.8355100 Image_0
##do any proteins show up more than once?
icounts<-negProts|>dplyr::group_by(PrimaryGeneName)|>
dplyr::summarize(numImgs=dplyr::n())|>
dplyr::arrange(desc(numImgs))
print(icounts)
## # A tibble: 436 × 2
## PrimaryGeneName numImgs
## <chr> <int>
## 1 SH3GL1 3
## 2 AP3S2 2
## 3 CHGA 2
## 4 CKB 2
## 5 CLTB 2
## 6 CTBP1 2
## 7 CUTA 2
## 8 DCAKD 2
## 9 DHX30 2
## 10 ECHS1 2
## # ℹ 426 more rows
It looks like SH3GL1 is correlated with distance to Islet in a few images.
Now we can plot the expression of a protein suspected to have decreasing expression farther from the islet cells.We start with SH3GL1 and SP3S2.
spatial_heatmap(img.spes[[3]], feature = 'SH3GL1',
feature_type='PrimaryGeneName',
sample_id=names(img.spes)[3],
image_id='with_grid',
spatial_coord_names=c('x_pixels','y_pixels'),
spot_size=unlist(colData(img.spes[[3]])[1,c('spot_width',
'spot_height')]),
image_boundaries=unlist(colData(img.spes[[3]])[1,c('x_origin',
'y_origin',
'x_max',
'y_max')]),
label_column='IsletOrNot', interactive=FALSE)
spatial_heatmap(img.spes[[5]], feature = 'AP3S2',
feature_type='PrimaryGeneName',
sample_id=names(img.spes)[5],
image_id='with_grid',
spatial_coord_names=c('x_pixels','y_pixels'),
spot_size=unlist(colData(img.spes[[5]])[1,c('spot_width',
'spot_height')]),
image_boundaries=unlist(colData(img.spes[[5]])[1,c('x_origin',
'y_origin',
'x_max',
'y_max')]),
label_column='IsletOrNot', interactive=FALSE)
The expression of this protein is lower farther from the Islet. Can we identify trends in the proteins?
Rank-based pathway enrichment is a way to evaluate trends pathways that are over-represented in a ranked list of genes. The leapR pathway has such functionality and we can use the rankings as input.
library(leapR)
data("msigdb")
enriched.paths<-do.call(rbind,lapply(names(rank.imgs),function(x){
spe=rank.imgs[[x]]
enrich_gradient(spe,
geneset=msigdb,
feature_column='PrimaryGeneName', #primary gene name to be mapped to enrichment data
ranking_column='IsletDistancespearmanCor')|>
tibble::rownames_to_column('msigdb')|>
dplyr::mutate(comp=x)
}))
## An Error Occurred
enriched.paths|>
subset(BH_pvalue<0.05)|>
dplyr::group_by(msigdb)|>
dplyr::summarize(numImgs=dplyr::n())|>
dplyr::arrange(desc(numImgs))
## # A tibble: 464 × 2
## msigdb numImgs
## <chr> <int>
## 1 KEGG_RIBOSOME 7
## 2 REACTOME_FORMATION_OF_A_POOL_OF_FREE_40S_SUBUNITS 7
## 3 REACTOME_GTP_HYDROLYSIS_AND_JOINING_OF_THE_60S_RIBOSOMAL_SUBUNIT 7
## 4 REACTOME_TRANSLATION 7
## 5 REACTOME_VIRAL_MRNA_TRANSLATION 7
## 6 REACTOME_PEPTIDE_CHAIN_ELONGATION 6
## 7 GCM_TPT1 5
## 8 MACROMOLECULE_BIOSYNTHETIC_PROCESS 5
## 9 MORF_DEK 5
## 10 REACTOME_INFLUENZA_VIRAL_RNA_TRANSCRIPTION_AND_REPLICATION 5
## # ℹ 454 more rows
We can see that numerous pathways are coming up as enriched across images, including ribosomal and translation related pathways. Now we can select proteins from a particular pathway and visualize those as well.
rprots<-subset(enriched.paths,msigdb=='KEGG_RIBOSOME')|>
dplyr::select(comp,ingroupnames)
rprots<-unlist(strsplit(rprots[1,2],split=', '))
spatial_heatmap(img.spes[[5]], feature = rprots,
feature_type='PrimaryGeneName',
sample_id=names(img.spes)[5],
image_id='with_grid',
spatial_coord_names=c('x_pixels','y_pixels'),
spot_size=unlist(colData(img.spes[[5]])[1,c('spot_width',
'spot_height')]),
image_boundaries=unlist(colData(img.spes[[5]])[1,c('x_origin',
'y_origin',
'x_max',
'y_max')]),
label_column='IsletOrNot', interactive=FALSE)
This shows the ribosomal protein expression across the image.
This vignette shows various functions to apply in managing spatial proteomics data in spammR.
## R version 4.4.2 (2024-10-31)
## Platform: aarch64-apple-darwin20
## Running under: macOS Sequoia 15.3.2
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
##
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## time zone: America/Los_Angeles
## tzcode source: internal
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] leapR_0.0.0.9000 cowplot_1.1.3
## [3] BiocStyle_2.34.0 spammR_0.1
## [5] limma_3.62.2 SpatialExperiment_1.16.0
## [7] SingleCellExperiment_1.28.1 SummarizedExperiment_1.36.0
## [9] Biobase_2.66.0 GenomicRanges_1.58.0
## [11] GenomeInfoDb_1.42.3 IRanges_2.40.1
## [13] S4Vectors_0.44.0 BiocGenerics_0.52.0
## [15] MatrixGenerics_1.18.1 matrixStats_1.5.0
##
## loaded via a namespace (and not attached):
## [1] rstudioapi_0.17.1 jsonlite_1.9.0 wk_0.9.4
## [4] magrittr_2.0.3 magick_2.8.5 farver_2.1.2
## [7] rmarkdown_2.29 fs_1.6.5 zlibbioc_1.52.0
## [10] vctrs_0.6.5 spdep_1.3-10 memoise_2.0.1
## [13] tinytex_0.56 rstatix_0.7.2 htmltools_0.5.8.1
## [16] S4Arrays_1.6.0 usethis_3.1.0 broom_1.0.7
## [19] s2_1.1.7 SparseArray_1.6.2 Formula_1.2-5
## [22] sass_0.4.9 spData_2.3.4 bslib_0.9.0
## [25] KernSmooth_2.23-26 htmlwidgets_1.6.4 desc_1.4.3
## [28] impute_1.80.0 plotly_4.10.4 cachem_1.1.0
## [31] commonmark_1.9.2 mime_0.12 lifecycle_1.0.4
## [34] pkgconfig_2.0.3 Matrix_1.7-2 R6_2.6.1
## [37] fastmap_1.2.0 GenomeInfoDbData_1.2.13 shiny_1.10.0
## [40] digest_0.6.37 colorspace_2.1-1 ggnewscale_0.5.1
## [43] rprojroot_2.0.4 pkgload_1.4.0 ggpubr_0.6.0
## [46] labeling_0.4.3 httr_1.4.7 abind_1.4-8
## [49] compiler_4.4.2 proxy_0.4-27 remotes_2.5.0
## [52] withr_3.0.2 backports_1.5.0 carData_3.0-5
## [55] DBI_1.2.3 pkgbuild_1.4.6 ggsignif_0.6.4
## [58] DelayedArray_0.32.0 sessioninfo_1.2.3 rjson_0.2.21
## [61] classInt_0.4-11 tools_4.4.2 units_0.8-5
## [64] httpuv_1.6.15 glue_1.8.0 promises_1.3.2
## [67] grid_4.4.2 sf_1.0-19 generics_0.1.3
## [70] gtable_0.3.6 class_7.3-23 tidyr_1.3.1
## [73] data.table_1.17.0 utf8_1.2.4 sp_2.2-0
## [76] xml2_1.3.7 car_3.1-3 XVector_0.46.0
## [79] ggrepel_0.9.6 pillar_1.10.1 stringr_1.5.1
## [82] later_1.4.1 dplyr_1.1.4 lattice_0.22-6
## [85] deldir_2.0-4 tidyselect_1.2.1 miniUI_0.1.1.1
## [88] knitr_1.49 bookdown_0.42 xfun_0.51
## [91] statmod_1.5.0 devtools_2.4.5 stringi_1.8.4
## [94] UCSC.utils_1.2.0 lazyeval_0.2.2 yaml_2.3.10
## [97] boot_1.3-31 evaluate_1.0.3 tibble_3.2.1
## [100] BiocManager_1.30.25 cli_3.6.4 xtable_1.8-4
## [103] jquerylib_0.1.4 munsell_0.5.1 roxygen2_7.3.2
## [106] Rcpp_1.0.14 png_0.1-8 ellipsis_0.3.2
## [109] ggplot2_3.5.1 profvis_0.4.0 urlchecker_1.0.1
## [112] viridisLite_0.4.2 scales_1.3.0 e1071_1.7-16
## [115] purrr_1.0.4 crayon_1.5.3 rlang_1.1.5